<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />

  <title>Class: CloudShell::Context</title>

  <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />

  <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>

</head>
<body id="top" class="class">

  <div id="metadata">
    <div id="home-metadata">
      <div id="home-section" class="section">
        <h3 class="section-header">
          <a href="../index.html">Home</a>
          <a href="../index.html#classes">Classes</a>
          <a href="../index.html#methods">Methods</a>
        </h3>
      </div>
    </div>

    <div id="file-metadata">
      <div id="file-list-section" class="section">
        <h3 class="section-header">In Files</h3>
        <div class="section-body">
          <ul>
          
            <li><a href="../lib/cloud_shell_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
              class="thickbox" title="lib/cloud_shell.rb">lib/cloud_shell.rb</a></li>
          
          </ul>
        </div>
      </div>

      
    </div>

    <div id="class-metadata">
      
      <!-- Parent Class -->
      <div id="parent-class-section" class="section">
        <h3 class="section-header">Parent</h3>
        
        <p class="link"><a href="../Object.html">Object</a></p>
        
      </div>
      

      

      

      
      <!-- Method Quickref -->
      <div id="method-list-section" class="section">
        <h3 class="section-header">Methods</h3>
        <ul class="link-list">
          
          <li><a href="#method-c-new">::new</a></li>
          
          <li><a href="#method-i-cat">#cat</a></li>
          
          <li><a href="#method-i-cd">#cd</a></li>
          
          <li><a href="#method-i-completions">#completions</a></li>
          
          <li><a href="#method-i-to_s">#to_s</a></li>
          
        </ul>
      </div>
      

      
    </div>

    <div id="project-metadata">
      
      
      <div id="fileindex-section" class="section project-section">
        <h3 class="section-header">Files</h3>
        <ul>
        
          <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
        
        </ul>
      </div>
      

      <div id="classindex-section" class="section project-section">
        <h3 class="section-header">Class/Module Index
          <span class="search-toggle"><img src="../images/find.png"
            height="16" width="16" alt="[+]"
            title="show/hide quicksearch" /></span></h3>
        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

        <ul class="link-list">
        
          <li><a href="../CloudShell.html">CloudShell</a></li>
        
          <li><a href="../CloudShell/Context.html">CloudShell::Context</a></li>
        
          <li><a href="../Configurator.html">Configurator</a></li>
        
          <li><a href="../Formatter.html">Formatter</a></li>
        
          <li><a href="../Object.html">Object</a></li>
        
          <li><a href="../Parser.html">Parser</a></li>
        
          <li><a href="../SwiftClient.html">SwiftClient</a></li>
        
          <li><a href="../SwiftManager.html">SwiftManager</a></li>
        
        </ul>
        <div id="no-class-search-results" style="display: none;">No matching classes.</div>
      </div>

      
    </div>
  </div>

  <div id="documentation">
    <h1 class="class">CloudShell::Context</h1>

    <div id="description" class="description">
      
    </div><!-- description -->

    
    
    
    <div id="5Buntitled-5D" class="documentation-section">
      

      

      

      
      <!-- Attributes -->
      <div id="attribute-method-details" class="method-section section">
        <h3 class="section-header">Attributes</h3>

        
        <div id="here-attribute-method" class="method-detail">
          <a name="here"></a>
          
          <div class="method-heading attribute-method-heading">
            <span class="method-name">here</span><span
              class="attribute-access-type">[R]</span>
          </div>

          <div class="method-description">
          
          
          
          </div>
        </div>
        
        <div id="parent_context-attribute-method" class="method-detail">
          <a name="parent_context"></a>
          
          <div class="method-heading attribute-method-heading">
            <span class="method-name">parent_context</span><span
              class="attribute-access-type">[R]</span>
          </div>

          <div class="method-description">
          
          
          
          </div>
        </div>
        
      </div><!-- attribute-method-details -->
      

      <!-- Methods -->
      
      <div id="public-class-method-details" class="method-section section">
        <h3 class="section-header">Public Class Methods</h3>

      
        <div id="new-method" class="method-detail ">
          <a name="method-c-new"></a>

          
          <div class="method-heading">
            <span class="method-name">new</span><span
              class="method-args">(here,parent_context)</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            
            

            
            <div class="method-source-code" id="new-source">
<pre>
<span class="ruby-comment"># File lib/cloud_shell.rb, line 74</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">here</span>,<span class="ruby-identifier">parent_context</span>)
  <span class="ruby-ivar">@here</span> = <span class="ruby-identifier">here</span>
  <span class="ruby-ivar">@parent_context</span> = <span class="ruby-identifier">parent_context</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- new-source -->
            
          </div>

          

          
        </div><!-- new-method -->

      
      </div><!-- public-class-method-details -->
    
      <div id="public-instance-method-details" class="method-section section">
        <h3 class="section-header">Public Instance Methods</h3>

      
        <div id="cat-method" class="method-detail ">
          <a name="method-i-cat"></a>

          
          <div class="method-heading">
            <span class="method-name">cat</span><span
              class="method-args">(path)</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            
            

            
            <div class="method-source-code" id="cat-source">
<pre>
<span class="ruby-comment"># File lib/cloud_shell.rb, line 83</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">cat</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">item_at</span>(<span class="ruby-identifier">path</span>)
<span class="ruby-keyword">end</span></pre>
            </div><!-- cat-source -->
            
          </div>

          

          
        </div><!-- cat-method -->

      
        <div id="cd-method" class="method-detail ">
          <a name="method-i-cd"></a>

          
          <div class="method-heading">
            <span class="method-name">cd</span><span
              class="method-args">(path)</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            
            

            
            <div class="method-source-code" id="cd-source">
<pre>
<span class="ruby-comment"># File lib/cloud_shell.rb, line 87</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">cd</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-string">'..'</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent_context</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">item</span> = <span class="ruby-identifier">item_at</span>(<span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">item</span>,<span class="ruby-keyword">self</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- cd-source -->
            
          </div>

          

          
        </div><!-- cd-method -->

      
        <div id="completions-method" class="method-detail ">
          <a name="method-i-completions"></a>

          
          <div class="method-heading">
            <span class="method-name">completions</span><span
              class="method-args">(input)</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            
            

            
            <div class="method-source-code" id="completions-source">
<pre>
<span class="ruby-comment"># File lib/cloud_shell.rb, line 79</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">completions</span>(<span class="ruby-identifier">input</span>)
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\s+/</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-node">/^#{input}/</span>)
  <span class="ruby-keyword">end</span></pre>
            </div><!-- completions-source -->
            
          </div>

          

          
        </div><!-- completions-method -->

      
        <div id="to_s-method" class="method-detail ">
          <a name="method-i-to_s"></a>

          
          <div class="method-heading">
            <span class="method-name">to_s</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            
            

            
            <div class="method-source-code" id="to_s-source">
<pre>
<span class="ruby-comment"># File lib/cloud_shell.rb, line 100</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
    <span class="ruby-identifier">indices</span> = []
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">each_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">indices</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">i</span> }
    <span class="ruby-identifier">indices</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Hash</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">here</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- to_s-source -->
            
          </div>

          

          
        </div><!-- to_s-method -->

      
      </div><!-- public-instance-method-details -->
    
    </div><!-- 5Buntitled-5D -->
  

  </div><!-- documentation -->

  <div id="validator-badges">
    <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
    <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
      Rdoc Generator</a> 2</small>.</p>
  </div>

</body>
</html>

